<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<link type="text/css" href="css/member_delete.css" rel="stylesheet" />
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="m" value="${readmember}"></c:set>
<div id="contents">
	<%@ include file="../tiles/mypagemn.jspf"%><!-- nav 메뉴 -->

	<form id="dmember" method="post">
		<label for="uid" class="blind">아이디</label> <input type="text"
			name="uid" id="muid" title="아이디" value="${sessionScope.uid }"
			placeholder="아이디" readonly="readonly" /> 
			
			<label for="rpwd" class="blind">비밀번호</label> <input type="password" name="rpwd"
			id="rpwd"  title="비밀번호" placeholder="비밀번호" />
		<button type="button" class="btn btn-default" id="deletebtn"
			onclick="deleteok()">멤버탈퇴</button>
	</form>
</div>

<script>
	function deleteok() {
		if ($("#rpwd").val() == "")
			alert("비밀번호를 입력하세요.");
		else if ($("#rpwd").val() != "${m.pwd}")
			alert("정확한 비밀번호를 입력해 주세요");

		else if ($("#rpwd").val() == "${m.pwd}")
			var frm = document.getElementById("dmember");
		frm.action = "mem_remove.bi?mno=${sessionScope.mno}";
		frm.method = "post";
		frm.submit();
	}
</script>